:root {
  --rf-bg: #dae0e6;
  --rf-paper: #ffffff;
  --rf-surface: #f6f7f8;
  --rf-ink: #1c1c1c;
  --rf-soft: #6b7280;
  --rf-line: #c8ccd1;
  --rf-accent: #ff4500;
  --rf-accent-2: #0079d3;
  --rf-radius: 6px;
  --reader-size: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--rf-ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--rf-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.rf-app {
  width: min(1280px, calc(100% - 16px));
  margin: 0 auto;
  padding: 12px 0 24px;
}

.rf-topbar {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--rf-line);
  background: var(--rf-paper);
}

.rf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.rf-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rf-accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.rf-brand-text {
  font-size: 18px;
}

.rf-search {
  display: flex;
  gap: 8px;
}

.rf-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rf-line);
  background: #fff;
  border-radius: var(--rf-radius);
  outline: none;
}

.rf-search button,
.rf-link,
.rf-menu,
.rf-compose-link,
.rf-pager a,
.rf-primary,
.rf-reader-tools a,
.rf-reader-tools button,
.rf-reader-continue,
.rf-reader-foot a,
.rf-backtop {
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.rf-search button,
.rf-link,
.rf-menu {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.rf-search button {
  background: var(--rf-accent);
  border-color: var(--rf-accent);
  color: #fff;
}

.rf-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 12px 0;
  border: 1px solid var(--rf-line);
  background: var(--rf-paper);
}

.rf-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
}

.rf-nav a.is-home,
.rf-nav a:hover,
.rf-search button:hover,
.rf-compose-link:hover {
  background: var(--rf-accent);
  color: #fff;
  border-color: var(--rf-accent);
}

.rf-primary:hover,
.rf-reader-continue:hover {
  background: #e03d00;
  color: #fff;
  border-color: #e03d00;
}

.rf-main {
  display: grid;
  gap: 12px;
}

.rf-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 260px;
  gap: 12px;
}

.rf-sidebar {
  display: grid;
  gap: 12px;
}

.rf-sidebox,
.rf-feed,
.rf-reader-card,
.rf-bookgrid,
.rf-bookhead,
.rf-breadcrumb,
.rf-listgroup,
.rf-category-stack {
  border: 1px solid var(--rf-line);
  background: var(--rf-paper);
}

.rf-sidebox {
  padding: 12px;
}

.rf-sidebox h2,
.rf-section-head h2,
.rf-feed-head h1,
.rf-bookmeta h1,
.rf-reader-head h1,
.rf-sidebox h1 {
  margin: 0;
  line-height: 1.18;
}

.rf-sidebox h2,
.rf-section-head h2 {
  font-size: 16px;
}

.rf-chiplist,
.rf-mini-list,
.rf-related,
.rf-chapters,
.rf-mini-list-wide {
  display: grid;
  gap: 8px;
}

.rf-chiplist a,
.rf-mini-list a,
.rf-category-pill,
.rf-chapters a,
.rf-related a {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--rf-line);
  background: #fff;
  border-radius: var(--rf-radius);
}

.rf-mini-list a strong,
.rf-mini-list-wide a strong,
.rf-related a strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.rf-mini-list a span,
.rf-mini-list-wide a span,
.rf-related a span,
.rf-side-note,
.rf-post-meta,
.rf-post-excerpt,
.rf-feed-head p,
.rf-bookmeta .rf-meta-row,
.rf-reader-head small {
  color: var(--rf-soft);
  font-size: 13px;
}

.rf-feed {
  padding: 12px;
}

.rf-feed-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rf-line);
  margin-bottom: 12px;
}

.rf-feed-head h1 {
  font-size: clamp(26px, 4vw, 40px);
}

.rf-compose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--rf-line);
  background: var(--rf-surface);
}

.rf-compose-mark {
  font-weight: 700;
}

.rf-compose-link {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.rf-postlist {
  display: grid;
  gap: 12px;
}

.rf-section-head {
  padding: 8px 0 10px;
}

.rf-section-head h2 {
  font-size: 18px;
}

.rf-post {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 96px;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--rf-line);
  background: #fff;
}

.rf-post-vote {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--rf-soft);
  font-size: 12px;
}

.rf-post-vote em {
  font-style: normal;
  font-weight: 700;
  color: var(--rf-ink);
}

.rf-post-main {
  min-width: 0;
}

.rf-post-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.rf-post-title a {
  font-size: 18px;
  font-weight: 700;
}

.rf-post-title span {
  color: var(--rf-soft);
  font-size: 13px;
}

.rf-post-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.rf-post-meta span {
  padding: 3px 8px;
  border: 1px solid var(--rf-line);
  background: var(--rf-surface);
}

.rf-post-excerpt {
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rf-post-thumb {
  display: block;
  width: 96px;
  align-self: start;
}

.rf-post-thumb img {
  width: 96px;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--rf-line);
  background: #fff;
}

.rf-post-list {
  margin-bottom: 12px;
}

.rf-post-list .rf-post-thumb {
  display: none;
}

.rf-list-layout {
  align-items: start;
}

.rf-feed-head {
  margin-bottom: 12px;
}

.rf-feed-head p {
  margin: 6px 0 0;
}

.rf-bookhead {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.rf-bookcover img {
  width: 128px;
  height: 170px;
  object-fit: cover;
  border: 1px solid var(--rf-line);
}

.rf-bookmeta {
  display: grid;
  gap: 10px;
}

.rf-book-cta {
  display: block;
}

.rf-primary-block {
  display: flex;
  width: 100%;
}

.rf-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rf-meta-row span {
  padding: 4px 8px;
  border: 1px solid var(--rf-line);
  background: #fff;
}

.rf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rf-primary,
.rf-reader-continue,
.rf-reader-foot a {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.rf-primary {
  background: var(--rf-accent);
  color: #fff;
  border-color: var(--rf-accent);
}

.rf-bookgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.rf-prose {
  padding: 12px;
  color: var(--rf-ink);
}

.rf-breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.rf-reader-shell {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.rf-reader-tools {
  display: grid;
  gap: 8px;
  align-self: start;
  position: sticky;
  top: 12px;
}

.rf-reader-tools a,
.rf-reader-tools button {
  min-height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.rf-reader-card {
  padding: 12px;
}

.rf-reader-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rf-line);
  margin-bottom: 12px;
}

.rf-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--rf-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rf-reader-continue {
  align-self: start;
  background: var(--rf-accent);
  color: #fff;
  border-color: var(--rf-accent);
}

.rf-reader-content {
  font-size: var(--reader-size);
  line-height: 1.95;
  color: var(--rf-ink);
}

.rf-reader-content p {
  margin: 0 0 1em;
}

.rf-reader-content img {
  display: block;
  margin: 12px auto;
  max-width: 100%;
  border: 1px solid var(--rf-line);
}

.rf-reader-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.rf-footer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--rf-line);
  background: var(--rf-paper);
  text-align: center;
}

.rf-friends,
.rf-footer-links,
.rf-extra {
  margin-bottom: 10px;
}

.rf-footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.rf-backtop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.rf-backtop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rf-lazy {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.rf-lazy.is-loaded {
  opacity: 1;
}

@media (hover: hover) {
  .rf-link:hover,
  .rf-menu:hover,
  .rf-compose-link:hover,
  .rf-pager a:hover,
  .rf-reader-tools a:hover,
  .rf-reader-tools button:hover,
  .rf-reader-foot a:hover,
  .rf-backtop:hover,
  .rf-chiplist a:hover,
  .rf-mini-list a:hover,
  .rf-category-pill:hover,
  .rf-chapters a:hover,
  .rf-related a:hover,
  .rf-post:hover,
  .rf-nav a:hover {
    background: var(--rf-surface);
  }
}

@media (max-width: 1080px) {
  .rf-topbar {
    grid-template-columns: 1fr;
  }

  .rf-layout,
  .rf-reader-shell {
    grid-template-columns: 1fr;
  }

  .rf-bookhead,
  .rf-bookgrid {
    grid-template-columns: 1fr;
  }

  .rf-post {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .rf-post-thumb {
    display: none;
  }
}

@media (max-width: 720px) {
  .rf-app {
    width: min(100% - 12px, 1280px);
    padding-top: 8px;
  }

  .rf-compose,
  .rf-post,
  .rf-reader-head {
    flex-direction: column;
  }

  .rf-reader-head {
    align-items: start;
  }

  .rf-reader-tools {
    display: flex;
    flex-wrap: wrap;
    position: static;
  }

  .rf-nav {
    display: none;
  }

  .rf-post {
    grid-template-columns: 56px 1fr;
  }

  .rf-post-list {
    grid-template-columns: 56px 1fr;
  }

  .rf-post-list .rf-post-thumb {
    display: none;
  }

  .rf-bookhead {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .rf-bookcover img {
    width: 92px;
    height: 124px;
  }
}
